//
//  RepairDetailCell.m
//  PropertyMananger
//
//  Created by bh on 17/1/16.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "RepairDetailCell.h"

@implementation RepairDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"repairDetailCellID";
    RepairDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(cell == nil) {
        cell = [[RepairDetailCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    //选中cell的颜色 -无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.infoLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.infoLabel];
        
        self.infoLabel.textColor = BHColor(51, 51, 51);
        self.infoLabel.font = BHFont(15);
        self.infoLabel.textAlignment = NSTextAlignmentLeft;
        
        [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 50, 25));
        }];
        
        self.lineView = [[UIView alloc]init];
        [self.contentView addSubview:self.lineView];
        self.lineView.backgroundColor = BHGrayColor;
        
        [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.equalTo(self.contentView).with.offset(15);
            make.bottom.equalTo(self.contentView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 15, 1));
        }];

        
        self.phoneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.phoneBtn];
        
        [self.phoneBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self).with.offset(-20);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(30, 30));
        }];
    }
    return self;
}


@end
